package com.dongjiantong.web.boss.config;/**
 * Created by cao on 2017/12/14.
 */

import com.dongjiantong.openplatform.core.OPHook;
import com.dongjiantong.openplatform.core.SecurityManager;
import com.dongjiantong.openplatform.entity.OPClientInfo;
import org.springframework.stereotype.Component;

/**
 * @author cao
 * @create 2017-12-14 上午9:44
 **/
@Component
public class OpenSecurityManager implements SecurityManager {

    @Override
    public OPClientInfo findClientByAppKey(String appKey) {
        //just for dev
        return new OPClientInfo(2L, appKey,"dongjiantong.boss.secret");
    }

    @Override
    public OPClientInfo findClientById(Long clientId) {
        return new OPClientInfo(clientId, "dongjiantong","dongjiantong.boss.secret");
    }

    @Override
    public boolean hasPermission(Long clientId, String method) {
        return true;
    }

    @Override
    public OPHook getHook(Long clientId, String method) {
        return null;
    }
}

